/*
 * @lc app=leetcode.cn id=1598 lang=typescript
 *
 * [1598] 文件夹操作日志搜集器
 */

// @lc code=start
function minOperations(logs: string[]): number {
    let stack: string[] = [];
    logs.forEach((i) => {
        switch (i) {
            case "./":
                break;
            case "../":
                stack.pop();
                break;
            default:
                stack.push(i);
        }
    });
    return stack.length;
}
// @lc code=end
